
    function textChanged() {
    	var q = document.getElementById("q").value;
    	var state = wave.getState();
    	delta = {};
    	delta["q"] = q;
    	state.submitDelta(delta);
    }
    
    function typeChanged() {
    	var type = document.getElementById("type").Value;
    	var state = wave.getState();
    	delta = {};
    	delta["state"] = state;
    	state.submitDelta(delta);
    }
    
    

    function renderInfo() {
      if (!wave.getState()) {
        return;
      }
      var state = wave.getState();
      var q = state.get("q","");
      document.getElementById("q").value = q;
      var type = state.get("type","track");
      document.getElementById("type").Value;
    }


    function init() {
      if (wave && wave.isInWaveContainer()) {
        wave.setStateCallback(renderInfo);
        wave.setParticipantCallback(renderInfo);
      }
    }
    gadgets.util.registerOnLoadHandler(init);